package com.rboat.exam.service.impl;

import java.util.List;
import com.rboat.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.rboat.exam.mapper.ExamTestPaperTypeMapper;
import com.rboat.exam.domain.ExamTestPaperType;
import com.rboat.exam.service.IExamTestPaperTypeService;
import com.rboat.common.core.text.Convert;

/**
 * 试卷类型Service业务层处理
 * 
 * @author rboat
 * @date 2019-09-02
 */
@Service
public class ExamTestPaperTypeServiceImpl implements IExamTestPaperTypeService 
{
    @Autowired
    private ExamTestPaperTypeMapper examTestPaperTypeMapper;

    /**
     * 查询试卷类型
     * 
     * @param id 试卷类型ID
     * @return 试卷类型
     */
    @Override
    public ExamTestPaperType selectExamTestPaperTypeById(String id)
    {
        return examTestPaperTypeMapper.selectExamTestPaperTypeById(id);
    }

    /**
     * 查询试卷类型列表
     * 
     * @param examTestPaperType 试卷类型
     * @return 试卷类型
     */
    @Override
    public List<ExamTestPaperType> selectExamTestPaperTypeList(ExamTestPaperType examTestPaperType)
    {
        return examTestPaperTypeMapper.selectExamTestPaperTypeList(examTestPaperType);
    }

    /**
     * 新增试卷类型
     * 
     * @param examTestPaperType 试卷类型
     * @return 结果
     */
    @Override
    public int insertExamTestPaperType(ExamTestPaperType examTestPaperType)
    {
        examTestPaperType.setCreateTime(DateUtils.getNowDate());
        return examTestPaperTypeMapper.insertExamTestPaperType(examTestPaperType);
    }

    /**
     * 修改试卷类型
     * 
     * @param examTestPaperType 试卷类型
     * @return 结果
     */
    @Override
    public int updateExamTestPaperType(ExamTestPaperType examTestPaperType)
    {
        examTestPaperType.setUpdateTime(DateUtils.getNowDate());
        return examTestPaperTypeMapper.updateExamTestPaperType(examTestPaperType);
    }

    /**
     * 删除试卷类型对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteExamTestPaperTypeByIds(String ids)
    {
        return examTestPaperTypeMapper.deleteExamTestPaperTypeByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除试卷类型信息
     * 
     * @param id 试卷类型ID
     * @return 结果
     */
    @Override
    public int deleteExamTestPaperTypeById(String id)
    {
        return examTestPaperTypeMapper.deleteExamTestPaperTypeById(id);
    }
}
